<?php $this->load->view('header', array('data' => $data));?>
<div id="center">
	<div id="left_box">
		<div class="module"><div class="text">用户管理</div></div>
		<div class="sub_module">
		<ul class="sub_module">
		<?php foreach ($data['module'][$data['current']['module']]['sub_module'] as $v) { ?>
			<li <?php if ($v['ename'] == $data['current']['sub_module']) echo "class='current'"; ?> ><a href="<?php echo "/{$data['current']['module']}/{$v['ename']}";?>"><?php echo $v['cname'];?></a></li>
		<?php }?>
		</ul>
		</div>
		<div class="desc_box1 desc_box">
			<div class="title"></div>
			<div class="content"></div>
		</div>
		<div class="desc_box2 desc_box">
			<div class="title"></div>
			<div class="content"></div>
		</div>
	</div>
	<div id="right_box">
		<fieldset id="group">
			<legend>选择要管理的用户组</legend>
			<select name="group_id">
				<option value="0">请选择</option>
				<?php foreach ($data['all_group'] as $g) {?>
				<option value="<?php echo $g['id'];?>"><?php echo $g['username'];?></option>
				<?php } ?>
			</select>
			<input type="button" id="group_button" value="确定" />
		</fieldset>
<?php if ($data['flag']) {?>
<div id="action">
		<fieldset id="join">
			<legend>用户组&nbsp;[<?php echo $data['user']['username'];?>]&nbsp;加入组员</legend>
			<form method="post" action="/user/group_join/" id="group_join">
			<input type="hidden" name="group_id" value="<?php echo $data['user']['id']; ?>" />
			<table>
				<tr>
					<td class="col1">选择用户</td>
					<td class="col2">
						<select name="user_id">
							<option value="0">请选择</option>
							<?php foreach ($data['all_user'] as $u) { ?>
							<option value="<?php echo $u['id']?>"><?php echo $u['username']; ?></option>
							<?php }?>
						</select>
					</td>
				</tr>
				<tr>
					<td class="col1">组内角色</td>
					<td class="col2">
						<input type="radio" name="group_role" value="0" checked="checked" />组员
						<input type="radio" name="group_role" value="1" />组长
					</td>
				</tr>
				<tr>
					<td class="col1"><input type="submit" value="确定" /></td>
					<td class="col2"></td>
				</tr>
			</table>
			</form>
		</fieldset>
		<fieldset id="member">
			<legend>用户组&nbsp;[<?php echo $data['user']['username'];?>]&nbsp;已有组员</legend>
			<ul>
			<?php foreach ($data['member'] as $v) {?>
				<li <?php if (in_array($v['id'], $data['leader'])) {echo "style='font-weight:800;color:#219a44;'";}?>><?php echo $v['username']; ?><a title="删除" href="javascript:void(0)" user_id="<?php echo $v['id'] . '_' . $data['user']['id']; ?>">x</a></li>
			<?php } ?>
			</ul>
		</fieldset>
</div>
<?php }?>
	</div>
</div>
<?php $this->load->view('footer') ?>
